package com.example.demo.controller;


import javax.mail.MessagingException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.example.demo.producer.SyncProducer;
import com.example.demo.utils.ApiResponse;


@RestController
public class TestController {
	
	@Autowired
	SyncProducer syncProducer;
	
    @RequestMapping(value = "/sendMailMsg",method = RequestMethod.GET )
    public ApiResponse<Object> testSend() throws MessagingException, InterruptedException {
    	syncProducer.sendMsg();
    	return ApiResponse.success("测试发送邮箱！");
    }

}